package com.lanswon.qzsmk.controller.cardManageController;

import java.util.HashMap;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.lanswon.qzsmk.service.cardManageService.MakeCardService;
import com.lanswon.qzsmk.vo.MakeCardParamVo;

@Controller
@RequestMapping(value="applicationBlankCardTask")
public class ApplicationBlankCardTaskController  {
	
	
	@Autowired
	MakeCardService mcs;
	
	/**
	 * 去空白卡制卡任务新增页面
	 * @return
	 */
	@RequiresPermissions("applicationBlankCardTask:index")
	@RequestMapping(value="/index",name="空白卡制卡任务新增页面,applicationBlankCardTask:index",method=RequestMethod.GET)
	public String goaddTask(HttpServletRequest request){
		//add
		request.getSession().setAttribute("sign", true);
		return "AddMakeCardTask";
	}
	
	
	/**
	 * 增加空白任务
	 * @param mcpv
	 * @param count1
	 * @return
	 * @throws Exception
	 */
	@RequiresPermissions("applicationBlankCardTask:addTaskSingle")
	@RequestMapping(value="/addTaskSingle",name="空白卡制卡新增任务,applicationBlankCardTask:addTaskSingle",method=RequestMethod.POST)
	@ResponseBody
	public Map<String, Object> addBlackCardTask(MakeCardParamVo mcpv ,String count1) throws Exception{
		Map<String,Object> map=new HashMap<String,Object>();
		System.out.println("生成不记名制卡任务+"+mcpv+"$$$"+count1);
		if(count1==""||count1==null){//增加
			mcs.GeneratCardMakeTask1(mcpv);
			map.put("statusCode", "200");
			map.put("message", "操作成功");
			map.put("callbackType", "closeCurrent");
		}
		return map;
		
	}
}
